﻿namespace SL651Center2.x.Enums
{
    /// <summary>
    /// 运行配置参数
    /// </summary>
    public enum RunConfigCode : byte
    {
        /// <summary>
        /// 定时报时间间隔
        /// </summary>
        RC_20 = 0x20,
        /// <summary>
        /// 加时报时间间隔
        /// </summary>
        RC_21 = 0x21,
        /// <summary>
        /// 降水量日起始时间
        /// </summary>
        RC_22 = 0x22,
        /// <summary>
        /// 采样间隔
        /// </summary>
        RC_23 = 0x23,
        /// <summary>
        /// 水位数据存储间隔
        /// </summary>
        RC_24 = 0x24,
        /// <summary>
        /// 雨量计分辨率
        /// </summary>
        RC_25 = 0x25,
        /// <summary>
        /// 水位计分辨率
        /// </summary>
        RC_26 = 0x26,
        /// <summary>
        /// 雨量加报阈值
        /// </summary>
        RC_27 = 0x27,
        /// <summary>
        /// 水位基值1
        /// </summary>
        RC_28 = 0x28,
        /// <summary>
        /// 水位基值2
        /// </summary>
        RC_29 = 0x29,
        /// <summary>
        /// 水位基值3
        /// </summary>
        RC_2A = 0x2A,
        /// <summary>
        /// 水位基值4
        /// </summary>
        RC_2B = 0x2B,
        /// <summary>
        /// 水位基值5
        /// </summary>
        RC_2C = 0x2C,
        /// <summary>
        /// 水位基值6
        /// </summary>
        RC_2D = 0x2D,
        /// <summary>
        /// 水位基值7
        /// </summary>
        RC_2E = 0x2E,
        /// <summary>
        /// 水位基值8
        /// </summary>
        RC_2F = 0x2F,
        /// <summary>
        /// 水位修正基值1
        /// </summary>
        RC_30 = 0x30,
        /// <summary>
        /// 水位修正基值2
        /// </summary>
        RC_31 = 0x31,
        /// <summary>
        /// 水位修正基值3
        /// </summary>
        RC_32 = 0x32,
        /// <summary>
        /// 水位修正基值4
        /// </summary>
        RC_33 = 0x33,
        /// <summary>
        /// 水位修正基值5
        /// </summary>
        RC_34 = 0x34,
        /// <summary>
        /// 水位修正基值6
        /// </summary>
        RC_35 = 0x35,
        /// <summary>
        /// 水位修正基值7
        /// </summary>
        RC_36 = 0x36,
        /// <summary>
        /// 水位修正基值8
        /// </summary>
        RC_37 = 0x37,
        /// <summary>
        /// 加报水位1
        /// </summary>
        RC_38 = 0x38,
        /// <summary>
        /// 加报水位2
        /// </summary>
        RC_39 = 0x39,
        /// <summary>
        /// 加报水位3
        /// </summary>
        RC_3A = 0x3A,
        /// <summary>
        /// 加报水位4
        /// </summary>
        RC_3B = 0x3B,
        /// <summary>
        /// 加报水位5
        /// </summary>
        RC_3C = 0x3C,
        /// <summary>
        /// 加报水位6
        /// </summary>
        RC_3D = 0x3D,
        /// <summary>
        /// 加报水位7
        /// </summary>
        RC_3E = 0x3E,
        /// <summary>
        /// 加报水位8
        /// </summary>
        RC_3F = 0x3F,
        /// <summary>
        /// 加报水位以上加报阈值
        /// </summary>
        RC_40 = 0x40,
        /// <summary>
        /// 加报水位以下加报阈值
        /// </summary>
        RC_41 = 0x41,
        /// <summary>
        /// 流量加报阈值
        /// </summary>
        RC_42 = 0x42,
        /// <summary>
        /// 流速加报阈值
        /// </summary>
        RC_43 = 0x43,
        /// <summary>
        /// 闸位加报阈值
        /// </summary>
        RC_44 = 0x44,
        /// <summary>
        /// 功率加报阈值
        /// </summary>
        RC_45 = 0x45,
        /// <summary>
        /// 气压加报阈值
        /// </summary>
        RC_46 = 0x46,
        /// <summary>
        /// 风速加报阈值
        /// </summary>
        RC_47 = 0x47,
        /// <summary>
        /// 水温加报阈值
        /// </summary>
        RC_48 = 0x48,
        /// <summary>
        /// 取(排)水口1上限水位
        /// </summary>
        RC_49 = 0x49,
        /// <summary>
        /// 取(排)水口1下限水位
        /// </summary>
        RC_4A = 0x4A,
        /// <summary>
        /// 取(排)水口2上限水位
        /// </summary>
        RC_4B = 0x4B,
        /// <summary>
        /// 取(排)水口2下限水位
        /// </summary>
        RC_4C = 0x4C,
        /// <summary>
        /// 取(排)水口3上限水位
        /// </summary>
        RC_4D = 0x4D,
        /// <summary>
        /// 取(排)水口3下限水位
        /// </summary>
        RC_4E = 0x4E,
        /// <summary>
        /// 取(排)水口4上限水位
        /// </summary>
        RC_4F = 0x4F,
        /// <summary>
        /// 取(排)水口4下限水位
        /// </summary>
        RC_50 = 0x50,
        /// <summary>
        /// 取(排)水口5上限水位
        /// </summary>
        RC_51 = 0x51,
        /// <summary>
        /// 取(排)水口5下限水位
        /// </summary>
        RC_52 = 0x52,
        /// <summary>
        /// 取(排)水口6上限水位
        /// </summary>
        RC_53 = 0x53,
        /// <summary>
        /// 取(排)水口6下限水位
        /// </summary>
        RC_54 = 0x54,
        /// <summary>
        /// 取(排)水口7上限水位
        /// </summary>
        RC_55 = 0x55,
        /// <summary>
        /// 取(排)水口7下限水位
        /// </summary>
        RC_56 = 0x56,
        /// <summary>
        /// 取(排)水口8上限水位
        /// </summary>
        RC_57 = 0x57,
        /// <summary>
        /// 取(排)水口8下限水位
        /// </summary>
        RC_58 = 0x58,
        /// <summary>
        /// 取(排)水口1上限水压
        /// </summary>
        RC_59 = 0x59,
        /// <summary>
        /// 取(排)水口1下限水压
        /// </summary>
        RC_5A = 0x5A,
        /// <summary>
        /// 取(排)水口2上限水压
        /// </summary>
        RC_5B = 0x5B,
        /// <summary>
        /// 取(排)水口2下限水压
        /// </summary>
        RC_5C = 0x5C,
        /// <summary>
        /// 取(排)水口3上限水压
        /// </summary>
        RC_5D = 0x5D,
        /// <summary>
        /// 取(排)水口3下限水压
        /// </summary>
        RC_5E = 0x5E,
        /// <summary>
        /// 取(排)水口4上限水压
        /// </summary>
        RC_5F = 0x5F,
        /// <summary>
        /// 取(排)水口4下限水压
        /// </summary>
        RC_60 = 0x60,
        /// <summary>
        /// 取(排)水口5上限水压
        /// </summary>
        RC_61 = 0x61,
        /// <summary>
        /// 取(排)水口5下限水压
        /// </summary>
        RC_62 = 0x62,
        /// <summary>
        /// 取(排)水口6上限水压
        /// </summary>
        RC_63 = 0x63,
        /// <summary>
        /// 取(排)水口6下限水压
        /// </summary>
        RC_64 = 0x64,
        /// <summary>
        /// 取(排)水口7上限水压
        /// </summary>
        RC_65 = 0x65,
        /// <summary>
        /// 取(排)水口7下限水压
        /// </summary>
        RC_66 = 0x66,
        /// <summary>
        /// 取(排)水口8上限水压
        /// </summary>
        RC_67 = 0x67,
        /// <summary>
        /// 取(排)水口8下限水压
        /// </summary>
        RC_68 = 0x68,
        /// <summary>
        /// 水温上限
        /// </summary>
        RC_69 = 0x69,
        /// <summary>
        /// 水温下限
        /// </summary>
        RC_6A = 0x6A,
        /// <summary>
        /// pH值上限
        /// </summary>
        RC_6B = 0x6B,
        /// <summary>
        /// pH值下限
        /// </summary>
        RC_6C = 0x6C,
        /// <summary>
        /// 溶解氧上限
        /// </summary>
        RC_6D = 0x6D,
        /// <summary>
        /// 溶解氧下限
        /// </summary>
        RC_6E = 0x6E,
        /// <summary>
        /// 高猛酸盐指数上限
        /// </summary>
        RC_6F = 0x6F,
        /// <summary>
        /// 高猛酸盐指数下限
        /// </summary>
        RC_70 = 0x70,
        /// <summary>
        /// 电导率上限
        /// </summary>
        RC_71 = 0x71,
        /// <summary>
        /// 电导率下限
        /// </summary>
        RC_72 = 0x72,
        /// <summary>
        /// 氧化还原电位上限
        /// </summary>
        RC_73 = 0x73,
        /// <summary>
        /// 氧化还原电位下限
        /// </summary>
        RC_74 = 0x74,
        /// <summary>
        /// 浊度上限
        /// </summary>
        RC_75 = 0x75,
        /// <summary>
        /// 浊度下限
        /// </summary>
        RC_76 = 0x76,
        /// <summary>
        /// 氨氮上限
        /// </summary>
        RC_77 = 0x77,
        /// <summary>
        /// 氨氮下限
        /// </summary>
        RC_78 = 0x78,
        /// <summary>
        /// 总氮上限
        /// </summary>
        RC_79 = 0x79,
        /// <summary>
        /// 总氮下限
        /// </summary>
        RC_7A = 0x7A,
        /// <summary>
        /// 铜上限
        /// </summary>
        RC_7B = 0x7B,
        /// <summary>
        /// 铜下限
        /// </summary>
        RC_7C = 0x7C,
        /// <summary>
        /// 锌上限
        /// </summary>
        RC_7D = 0x7D,
        /// <summary>
        /// 锌下限
        /// </summary>
        RC_7E = 0x7E,
        /// <summary>
        /// 氟化物上限
        /// </summary>
        RC_7F = 0x7F,
        /// <summary>
        /// 氟化物下限
        /// </summary>
        RC_80 = 0x80,
        /// <summary>
        /// 硒上限
        /// </summary>
        RC_81 = 0x81,
        /// <summary>
        /// 硒下限
        /// </summary>
        RC_82 = 0x82,
        /// <summary>
        /// 砷上限
        /// </summary>
        RC_83 = 0x83,
        /// <summary>
        /// 砷下限
        /// </summary>
        RC_84 = 0x84,
        /// <summary>
        /// 汞上限
        /// </summary>
        RC_85 = 0x85,
        /// <summary>
        /// 汞下限
        /// </summary>
        RC_86 = 0x86,
        /// <summary>
        /// 镉上限
        /// </summary>
        RC_87 = 0x87,
        /// <summary>
        /// 镉下限
        /// </summary>
        RC_88 = 0x88,
        /// <summary>
        /// 总有机碳上限
        /// </summary>
        RC_89 = 0x89,
        /// <summary>
        /// 总有机碳下限
        /// </summary>
        RC_8A = 0x8A,
        /// <summary>
        /// 叶绿素上限
        /// </summary>
        RC_8B = 0x8B,
        /// <summary>
        /// 叶绿素下限
        /// </summary>
        RC_8C = 0x8C,
        /// <summary>
        /// 流量上限
        /// </summary>
        RC_8D = 0x8D,
        /// <summary>
        /// 水表1充值水量
        /// </summary>
        RC_8E = 0x8E,
        /// <summary>
        /// 水表2充值水量
        /// </summary>
        RC_8F = 0x8F,
        /// <summary>
        /// 水表3充值水量
        /// </summary>
        RC_90 = 0x90,
        /// <summary>
        /// 水表4充值水量
        /// </summary>
        RC_91 = 0x91,
        /// <summary>
        /// 水表5充值水量
        /// </summary>
        RC_92 = 0x92,
        /// <summary>
        /// 水表6充值水量
        /// </summary>
        RC_93 = 0x93,
        /// <summary>
        /// 水表7充值水量
        /// </summary>
        RC_94 = 0x94,
        /// <summary>
        /// 水表8充值水量
        /// </summary>
        RC_95 = 0x95,
        /// <summary>
        /// 水量定值量
        /// </summary>
        RC_96 = 0x96,
        /// <summary>
        /// 固态存储数据初始化
        /// </summary>
        RC_97 = 0x97,
        /// <summary>
        /// 遥测终端参数恢复出厂设置
        /// </summary>
        RC_98 = 0x98,
        /// <summary>
        /// 水表1水量表底(初始)值
        /// </summary>
        RC_99 = 0x99,
        /// <summary>
        /// 水表2水量表底(初始)值
        /// </summary>
        RC_9A = 0x9A,
        /// <summary>
        /// 水表3水量表底(初始)值
        /// </summary>
        RC_9B = 0x9B,
        /// <summary>
        /// 水表4水量表底(初始)值
        /// </summary>
        RC_9C = 0x9C,
        /// <summary>
        /// 水表5水量表底(初始)值
        /// </summary>
        RC_9D = 0x9D,
        /// <summary>
        /// 水表6水量表底(初始)值
        /// </summary>
        RC_9E = 0x9E,
        /// <summary>
        /// 水表7水量表底(初始)值
        /// </summary>
        RC_9F = 0x9F,
        /// <summary>
        /// 水表8水量表底(初始)值
        /// </summary>
        RC_A0 = 0xA0,
        /// <summary>
        /// 水表1剩余水量报警值
        /// </summary>
        RC_A1 = 0xA1,
        /// <summary>
        /// 水表2剩余水量报警值
        /// </summary>
        RC_A2 = 0xA2,
        /// <summary>
        /// 水表3剩余水量报警值
        /// </summary>
        RC_A3 = 0xA3,
        /// <summary>
        /// 水表4剩余水量报警值
        /// </summary>
        RC_A4 = 0xA4,
        /// <summary>
        /// 水表5剩余水量报警值
        /// </summary>
        RC_A5 = 0xA5,
        /// <summary>
        /// 水表6剩余水量报警值
        /// </summary>
        RC_A6 = 0xA6,
        /// <summary>
        /// 水表7剩余水量报警值
        /// </summary>
        RC_A7 = 0xA7,
        /// <summary>
        /// 水表8剩余水量报警值
        /// </summary>
        RC_A8 = 0xA8,
    }

    /// <summary>
    /// 运行配置参数信息
    /// </summary>
    public class RunConfigInfo
    {
        public static RunConfigInfo Instance { get; } = new RunConfigInfo();
        private Dictionary<RunConfigCode, (string name, string units)> _runConfigInfo = new Dictionary<RunConfigCode, (string name, string units)>();

        private RunConfigInfo()
        {
            Register(RunConfigCode.RC_20, ("定时报时间间隔", ""));
            Register(RunConfigCode.RC_21, ("加时报时间间隔", ""));
            Register(RunConfigCode.RC_22, ("降水量起始时间", "h"));
            Register(RunConfigCode.RC_23, ("采样间隔", "s"));
            Register(RunConfigCode.RC_24, ("水位数据存储间隔", "min"));
            Register(RunConfigCode.RC_25, ("雨量计分辨力", "mm"));
            Register(RunConfigCode.RC_26, ("水位计分辨力", "cm"));
            Register(RunConfigCode.RC_27, ("雨量加报阈值", "mm"));
            Register(RunConfigCode.RC_28, ("水位基值1", "m"));
            Register(RunConfigCode.RC_29, ("水位基值2", "m"));
            Register(RunConfigCode.RC_2A, ("水位基值3", "m"));
            Register(RunConfigCode.RC_2B, ("水位基值4", "m"));
            Register(RunConfigCode.RC_2C, ("水位基值5", "m"));
            Register(RunConfigCode.RC_2D, ("水位基值6", "m"));
            Register(RunConfigCode.RC_2E, ("水位基值7", "m"));
            Register(RunConfigCode.RC_2F, ("水位基值8", "m"));
            Register(RunConfigCode.RC_30, ("水位修正基值1", "m"));
            Register(RunConfigCode.RC_31, ("水位修正基值2", "m"));
            Register(RunConfigCode.RC_32, ("水位修正基值3", "m"));
            Register(RunConfigCode.RC_33, ("水位修正基值4", "m"));
            Register(RunConfigCode.RC_34, ("水位修正基值5", "m"));
            Register(RunConfigCode.RC_35, ("水位修正基值6", "m"));
            Register(RunConfigCode.RC_36, ("水位修正基值7", "m"));
            Register(RunConfigCode.RC_37, ("水位修正基值8", "m"));
            Register(RunConfigCode.RC_38, ("加报水位1", "m"));
            Register(RunConfigCode.RC_39, ("加报水位2", "m"));
            Register(RunConfigCode.RC_3A, ("加报水位3", "m"));
            Register(RunConfigCode.RC_3B, ("加报水位4", "m"));
            Register(RunConfigCode.RC_3C, ("加报水位5", "m"));
            Register(RunConfigCode.RC_3D, ("加报水位6", "m"));
            Register(RunConfigCode.RC_3E, ("加报水位7", "m"));
            Register(RunConfigCode.RC_3F, ("加报水位8", "m"));
            Register(RunConfigCode.RC_40, ("加报水位以上加报阈值", "m"));
            Register(RunConfigCode.RC_41, ("加报水位以下加报阈值", "m"));
            Register(RunConfigCode.RC_42, ("流量加报阈值", "㎡/s"));
            Register(RunConfigCode.RC_43, ("流速加报阈值", "m/s"));
            Register(RunConfigCode.RC_44, ("闸位加报阈值", "m"));
            Register(RunConfigCode.RC_45, ("功率加报阈值", "kW"));
            Register(RunConfigCode.RC_46, ("气压加报阈值", "100Pa"));
            Register(RunConfigCode.RC_47, ("风速加报阈值", "m/s"));
            Register(RunConfigCode.RC_48, ("水温加报阈值", "℃"));
            Register(RunConfigCode.RC_49, ("取(排)水口1上限水位", "m"));
            Register(RunConfigCode.RC_4A, ("取(排)水口1下限水位", "m"));
            Register(RunConfigCode.RC_4B, ("取(排)水口2上限水位", "m"));
            Register(RunConfigCode.RC_4C, ("取(排)水口2下限水位", "m"));
            Register(RunConfigCode.RC_4D, ("取(排)水口3上限水位", "m"));
            Register(RunConfigCode.RC_4E, ("取(排)水口3下限水位", "m"));
            Register(RunConfigCode.RC_4F, ("取(排)水口4上限水位", "m"));
            Register(RunConfigCode.RC_50, ("取(排)水口4下限水位", "m"));
            Register(RunConfigCode.RC_51, ("取(排)水口5上限水位", "m"));
            Register(RunConfigCode.RC_52, ("取(排)水口5下限水位", "m"));
            Register(RunConfigCode.RC_53, ("取(排)水口6上限水位", "m"));
            Register(RunConfigCode.RC_54, ("取(排)水口6下限水位", "m"));
            Register(RunConfigCode.RC_55, ("取(排)水口7上限水位", "m"));
            Register(RunConfigCode.RC_56, ("取(排)水口7下限水位", "m"));
            Register(RunConfigCode.RC_57, ("取(排)水口8上限水位", "m"));
            Register(RunConfigCode.RC_58, ("取(排)水口8下限水位", "m"));
            Register(RunConfigCode.RC_59, ("取(排)水口1上限水压", "m"));
            Register(RunConfigCode.RC_5A, ("取(排)水口1下限水压", "m"));
            Register(RunConfigCode.RC_5B, ("取(排)水口2上限水压", "m"));
            Register(RunConfigCode.RC_5C, ("取(排)水口2下限水压", "m"));
            Register(RunConfigCode.RC_5D, ("取(排)水口3上限水压", "m"));
            Register(RunConfigCode.RC_5E, ("取(排)水口3下限水压", "m"));
            Register(RunConfigCode.RC_5F, ("取(排)水口4上限水压", "m"));
            Register(RunConfigCode.RC_60, ("取(排)水口4下限水压", "m"));
            Register(RunConfigCode.RC_61, ("取(排)水口5上限水压", "m"));
            Register(RunConfigCode.RC_62, ("取(排)水口5下限水压", "m"));
            Register(RunConfigCode.RC_63, ("取(排)水口6上限水压", "m"));
            Register(RunConfigCode.RC_64, ("取(排)水口6下限水压", "m"));
            Register(RunConfigCode.RC_65, ("取(排)水口7上限水压", "m"));
            Register(RunConfigCode.RC_66, ("取(排)水口7下限水压", "m"));
            Register(RunConfigCode.RC_67, ("取(排)水口8上限水压", "m"));
            Register(RunConfigCode.RC_68, ("取(排)水口8下限水压", "m"));
            Register(RunConfigCode.RC_69, ("水温上限", "℃"));
            Register(RunConfigCode.RC_6A, ("水温下限", "℃"));
            Register(RunConfigCode.RC_6B, ("pH值上限", ""));
            Register(RunConfigCode.RC_6C, ("pH值下限", ""));
            Register(RunConfigCode.RC_6D, ("溶解氧上限", "mg/L"));
            Register(RunConfigCode.RC_6E, ("溶解氧下限", "mg/L"));
            Register(RunConfigCode.RC_6F, ("高猛酸盐指数上限", "mg/L"));
            Register(RunConfigCode.RC_70, ("高猛酸盐指数下限", "mg/L"));
            Register(RunConfigCode.RC_71, ("电导率上限", "μS/cm"));
            Register(RunConfigCode.RC_72, ("电导率下限", "μS/cm"));
            Register(RunConfigCode.RC_73, ("氧化还原电位上限", "mV"));
            Register(RunConfigCode.RC_74, ("氧化还原电位下限", "mV"));
            Register(RunConfigCode.RC_75, ("浊度上限", "度"));
            Register(RunConfigCode.RC_76, ("浊度下限", "度"));
            Register(RunConfigCode.RC_77, ("氨氮上限", "mg/L"));
            Register(RunConfigCode.RC_78, ("氨氮下限", "mg/L"));
            Register(RunConfigCode.RC_79, ("总氮上限", "mg/L"));
            Register(RunConfigCode.RC_7A, ("总氮下限", "mg/L"));
            Register(RunConfigCode.RC_7B, ("铜上限", "mg/L"));
            Register(RunConfigCode.RC_7C, ("铜下限", "mg/L"));
            Register(RunConfigCode.RC_7D, ("锌上限", "mg/L"));
            Register(RunConfigCode.RC_7E, ("锌下限", "mg/L"));
            Register(RunConfigCode.RC_7F, ("氟化物上限", "mg/L"));
            Register(RunConfigCode.RC_80, ("氟化物下限", "mg/L"));
            Register(RunConfigCode.RC_81, ("硒上限", "mg/L"));
            Register(RunConfigCode.RC_82, ("硒下限", "mg/L"));
            Register(RunConfigCode.RC_83, ("砷上限", "mg/L"));
            Register(RunConfigCode.RC_84, ("砷下限", "mg/L"));
            Register(RunConfigCode.RC_85, ("汞上限", "mg/L"));
            Register(RunConfigCode.RC_86, ("汞下限", "mg/L"));
            Register(RunConfigCode.RC_87, ("镉上限", "mg/L"));
            Register(RunConfigCode.RC_88, ("镉下限", "mg/L"));
            Register(RunConfigCode.RC_89, ("总有机碳上限", "mg/L"));
            Register(RunConfigCode.RC_8A, ("总有机碳下限", "mg/L"));
            Register(RunConfigCode.RC_8B, ("叶绿素上限", "mg/L"));
            Register(RunConfigCode.RC_8C, ("叶绿素下限", "mg/L"));
            Register(RunConfigCode.RC_8D, ("流量上限", "m³/s"));
            Register(RunConfigCode.RC_8E, ("水表1充值水量", "m³"));
            Register(RunConfigCode.RC_8F, ("水表2充值水量", "m³"));
            Register(RunConfigCode.RC_90, ("水表3充值水量", "m³"));
            Register(RunConfigCode.RC_91, ("水表4充值水量", "m³"));
            Register(RunConfigCode.RC_92, ("水表5充值水量", "m³"));
            Register(RunConfigCode.RC_93, ("水表6充值水量", "m³"));
            Register(RunConfigCode.RC_94, ("水表7充值水量", "m³"));
            Register(RunConfigCode.RC_95, ("水表8充值水量", "m³"));
            Register(RunConfigCode.RC_96, ("水量定值量", "m³"));
            Register(RunConfigCode.RC_97, ("固态存储数据初始化", ""));
            Register(RunConfigCode.RC_98, ("遥测终端参数恢复出厂设置", ""));
            Register(RunConfigCode.RC_99, ("水表1水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9A, ("水表2水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9B, ("水表3水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9C, ("水表4水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9D, ("水表5水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9E, ("水表6水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_9F, ("水表7水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_A0, ("水表8水量表底(初始)值", "m³"));
            Register(RunConfigCode.RC_A1, ("水表1剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A2, ("水表2剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A3, ("水表3剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A4, ("水表4剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A5, ("水表5剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A6, ("水表6剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A7, ("水表7剩余水量报警值", "m³"));
            Register(RunConfigCode.RC_A8, ("水表8剩余水量报警值", "m³"));
        }

        private void Register(RunConfigCode code, (string name, string units) info)
        {
            _runConfigInfo[code] = info;
        }

        /// <summary>
        /// 获取运行配置的数据长度和精度
        /// </summary>
        /// <param name="code">运行配置编码</param>
        /// <returns>数据的字节长度和精度</returns>
        public static (int d, decimal pre) GetValueType(byte code)
        {
            switch (code)
            {
                case 0x20:
                case 0x21:
                case 0x22:
                case 0x24:
                case 0x27:
                    return (1, 1);
                case 0x23:
                case 0x46:
                case 0x75:
                case 0x76:
                    return (2, 1);
                case 0x25:
                case 0x26:
                case 0x48:
                case 0x6B:
                case 0x6C:
                    return (1, 10);
                case 0x28:
                case 0x29:
                case 0x2A:
                case 0x2B:
                case 0x2C:
                case 0x2D:
                case 0x2E:
                case 0x2F:
                    return (4, 1000);
                case 0x30:
                case 0x31:
                case 0x32:
                case 0x33:
                case 0x34:
                case 0x35:
                case 0x36:
                case 0x37:
                case 0x42:
                case 0x43:
                    return (3, 1000);
                case 0x38:
                case 0x39:
                case 0x3A:
                case 0x3B:
                case 0x3C:
                case 0x3D:
                case 0x3E:
                case 0x3F:
                case 0x40:
                case 0x41:
                case 0x44:
                case 0x47:
                case 0x49:
                case 0x4A:
                case 0x4B:
                case 0x4C:
                case 0x4D:
                case 0x4E:
                case 0x4F:
                case 0x50:
                case 0x51:
                case 0x52:
                case 0x53:
                case 0x54:
                case 0x55:
                case 0x56:
                case 0x57:
                case 0x58:
                case 0x89:
                case 0x8A:
                case 0x8B:
                case 0x8C:
                    return (2, 100);
                case 0x45:
                case 0x71:
                case 0x72:
                    return (3, 1);
                case 0x59:
                case 0x5A:
                case 0x5B:
                case 0x5C:
                case 0x5D:
                case 0x5E:
                case 0x5F:
                case 0x60:
                case 0x61:
                case 0x62:
                case 0x63:
                case 0x64:
                case 0x65:
                case 0x66:
                case 0x67:
                case 0x68:
                    return (4, 100);
                case 0x69:
                case 0x6A:
                case 0x6D:
                case 0x6E:
                case 0x6F:
                case 0x70:
                    return (2, 10);
                case 0x73:
                case 0x74:
                    return (3, 10);
                case 0x77:
                case 0x78:
                case 0x79:
                case 0x7A:
                    return (3, 100);
                case 0x7B:
                case 0x7C:
                    return (4, 10000);
                case 0x7D:
                case 0x7E:
                    return (3, 10000);
                case 0x7F:
                case 0x80:
                    return (3, 100);
                case 0x81:
                case 0x82:
                case 0x83:
                case 0x84:
                case 0x85:
                case 0x86:
                case 0x87:
                case 0x88:
                    return (4, 100000);
                case 0x8E:
                case 0x8F:
                case 0x90:
                case 0x91:
                case 0x92:
                case 0x93:
                case 0x94:
                case 0x95:
                case 0x96:
                case 0x99:
                case 0x9A:
                case 0x9B:
                case 0x9C:
                case 0x9D:
                case 0x9E:
                case 0x9F:
                case 0xA0:
                case 0xA1:
                case 0xA2:
                case 0xA3:
                case 0xA4:
                case 0xA5:
                case 0xA6:
                case 0xA7:
                case 0xA8:
                    return (6, 1000);
                default:
                    return (0, 1);
            }
        }

        /// <summary>
        /// 获取运行配置的名称和单位
        /// </summary>
        /// <param name="code">运行配置编码</param>
        /// <returns>运行配置的名称和单位</returns>
        public (string name, string units) GetInfo(RunConfigCode code)
        {
            if (_runConfigInfo.TryGetValue(code, out var info))
            {
                return info;
            }
            return ("", "");
        }

    }

}
